//
//  WonderfulStroyCollectionViewCell.m
//  Travel
//
//  Created by 王嘉倩 on 15/9/18.
//  Copyright (c) 2015年 TeamThree. All rights reserved.
//

#import "WonderfulStroyCollectionViewCell.h"

@implementation WonderfulStroyCollectionViewCell

-(void)dealloc {
    [_showImgView release];
    [_userImgView release];
    [_userLabel release];
    [_titleLabel release];
    [_backImgView release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        CGFloat height = self.frame.size.height;
        CGFloat width = self.frame.size.width;
        
        self.backgroundColor = [UIColor colorWithRed:0.969 green:0.949 blue:0.902 alpha:1.000];
        
        _backImgView = [[UIImageView alloc] initWithFrame:(CGRectMake(0, 0, width, height))];
        _backImgView.backgroundColor = [UIColor whiteColor];
        _backImgView.layer.masksToBounds = YES;
        _backImgView.layer.cornerRadius = 5;
        [self addSubview:_backImgView];
        
        _showImgView = [[UIImageView alloc] initWithFrame:(CGRectMake(0, 0, width, kWidth / (375.0 / 130)))];
        _showImgView.backgroundColor = [UIColor orangeColor];
        [_backImgView addSubview:_showImgView];
        
        _titleLabel = [[UILabel alloc] initWithFrame:(CGRectMake(kWidth / (375.0 / 8), _showImgView.frame.origin.y + kWidth / (375.0 / 130) + kWidth / (375.0 / 10), _showImgView.frame.size.width - (kWidth / (375.0 / 16)), kWidth / (375.0 / 40)))];
        _titleLabel.text = @"逛完大昭寺，我们赶往布达拉宫广场，中途打听到一个逛完大昭寺，我们赶往布达拉宫广场，中途打听到一个";
        _titleLabel.numberOfLines = 0;
        _titleLabel.font = [UIFont systemFontOfSize:13.0];
        [_backImgView addSubview:_titleLabel];
        
        _userImgView = [[UIImageView alloc] initWithFrame:CGRectMake(kWidth / (375.0 / 8), height - (kWidth / (375.0 / 30)), 20, 20)];
        _userImgView.backgroundColor = [UIColor purpleColor];
        _userImgView.layer.masksToBounds = YES;
        _userImgView.layer.cornerRadius = _userImgView.bounds.size.width / 2;
        [_backImgView addSubview:_userImgView];
        
        _userLabel = [[UILabel alloc] initWithFrame:(CGRectMake(kWidth / (375.0 / 8) + 25, _userImgView.frame.origin.y, 200, 20))];
        _userLabel.text = @"by 越野楼";
        _userLabel.textColor = [UIColor grayColor];
        _userLabel.font = [UIFont systemFontOfSize:10.0];
        [_backImgView addSubview:_userLabel];
    }
    return self;
}
@end
